package edu.up.sky.service.impl;

import edu.up.sky.dao.UserMapper;
import edu.up.sky.pojo.User;
import edu.up.sky.service.UserService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.math.BigInteger;

@Service
public class UserServiceImpl implements UserService {
    @Resource
    private UserMapper userMapper;

    @Override
    public void registerUser(User user) {
        userMapper.insertSelective(user);
    }

    @Override
    public User login(BigInteger uid, String password) {
        User user = new User();
        user.setUid(uid);
        user.setPassword(password);

        return userMapper.findUserLogin(user);
    }
}
